/**
 * The data class representing an instruction in the Listing.
 *
 * An instruction is the logical representation of one line of the input.  All
 * data on the line (including comments) is included, so the listing file can
 * be reproduced.  Note that Instruction is used for directives as well as true
 * instructions.
 *
 * The main functionality provided by an instruction is code generation, via
 * the getBinary() method.  This method will convert the instruction into a
 * 32-bit Integer, using the supplied operands.  For directives that don't
 * actually generate code (eg KICKO or NEWLC), this method should return null.
 * Such Instructions should also implement the Instruction.Directive interface,
 * which exposes a process(IListing, ISymTable) method to allow them to perform
 * arbitrary actions.
 *
 * @author Andrew Krieger
 * @version 0.1
 * @since 6 Apr 2012
 */
public class ArithmeticInstruction extends Instruction {
    /**
     * Construct an arithmetic instruction
     * @param line The current line number
     * @param label The label associated with this instruction, or null
     * @param comment The comment after the semicolon, or null
     * @param mnemonic The mnemonic on this line, or null of the line contains
     *        only a comment
     * @param ops A list of operands supplied on the line
     */
    public ArithmeticInstruction(int lc, String label, String comment,
                          Mnemonic mnemonic, Iterable<Operand> ops) {
	super(lc, label, comment, mnemonic, ops);
    }

    public Integer getBinary () {
	return mnemonic.getOpcode() << 26;
    }
}
